home *** CD-ROM | disk | FTP | other *** search
/ Aminet 7 / Aminet 7 - August 1995.iso / Aminet / comm / mebbs / lastu421.lha / logon.rexx < prev   
OS/2 REXX Batch file  |  1994-08-11  |  7KB  |  191 lines

  1. /***************************************************/
  2. /* $VER: LastUser_4.21 (11 Aug 1994)               */
  3. /* $Filename: logon.rexx $                         */
  4. /* $Version: 4.21 $                                */
  5. /* $Date: 11 Aug 1994 $                            */
  6. /* $Creation: 04 Nov 1993 $                        */
  7. /***************************************************/
  8.  
  9. parse arg LineNumber
  10. signal on ERROR
  11.  
  12. DoorName = "LastUser"
  13.  
  14. if( ~show( 'l', "mebbsarexx.library" ) )then do
  15.    say "Opening mebbsarexx.library"
  16.  if( ~addlib( "mebbsarexx.library", 0, -30, 0 ) )then do
  17.       say "Could not open library"
  18.       exit 10
  19.    end
  20. end
  21.  
  22. call GetVar DoorName,LineNumber,1  ;  username=result
  23. call GetVar DoorName,LineNumber,4  ;  city=result
  24. call GetVar DoorName,LineNumber,8  ;  gfx=result
  25. call GetVar DoorName,LineNumber,11 ;  calls=result
  26. call GetVar DoorName,LineNumber,18 ;  total_calls=result
  27. call GetVar DoorName,LineNumber,20 ;  access=result
  28.  
  29. if ~open(baud,'mebbsnet:call.log','R') then do
  30.     bps = "????"
  31.     call START
  32.     end
  33. parse value readln(baud) with word1 word2 word3 word4 word5 word6 word7 word8 word9 word10 word11
  34. if word10 = "(1200" then bps = "1200"
  35. if word10 = "(2400" then bps = "2400"
  36. if word10 = "(4800" then bps = "4800"
  37. if word10 = "(9600" then bps = "9600"
  38. if word10 = "(14400" then bps = "14k4"
  39. if word10 = "(16800" then bps = "16k8"
  40. if word10 = "(19200" then bps = "19k2"
  41. if word10 = "(21600" then bps = "21k6"
  42. if word10 = "(28800" then bps = "28k8"
  43. if word10 = "(38400" then bps = "38k4"
  44. if word10 = "" then bps = "Local"
  45. call close(baud)
  46.  
  47. START:
  48. CLS = 'H'
  49. path="DOORS:"
  50. a=0
  51. if gfx=0 then do
  52.    ROD    =''
  53.    GRON   =''
  54.    GUL    =''
  55.    BLA    =''
  56.    LILA   =''
  57.    CYAN   =''
  58.    VIT    =''
  59.    SVART2 =''
  60.    BLA2   =''
  61. end
  62. if gfx>=1 then do
  63.    ROD    =''
  64.    GRON   =''
  65.    GUL    =''
  66.    BLA    =''
  67.    LILA   =''
  68.    CYAN   =''
  69.    VIT    =''
  70.    SVART2 =''
  71.    BLA2   =''
  72. end
  73.  
  74. if ~exists(path'lastuser') then do
  75.    address command 'c:Makedir 'path'lastuser'
  76.    call open(file,PATH'lastuser/lastuser.txt','W')
  77.    call writeln file, " Name                l Axxl City          l Baud l Callsl Logon - Logoffl"
  78.    call writeln file, " Name                l Axxl City          l Baud l Callsl Logon - Logoffl"
  79.    call writeln file, " Name                l Axxl City          l Baud l Callsl Logon - Logoffl"
  80.    call writeln file, " Name                l Axxl City          l Baud l Callsl Logon - Logoffl"
  81.    call writeln file, " Name                l Axxl City          l Baud l Callsl Logon - Logoffl"
  82.    call writeln file, " Name                l Axxl City          l Baud l Callsl Logon - Logoffl"
  83.    call writeln file, " Name                l Axxl City          l Baud l Callsl Logon - Logoffl"
  84.    call writeln file, " Name                l Axxl City          l Baud l Callsl Logon - Logoffl"
  85.    call writeln file, " Name                l Axxl City          l Baud l Callsl Logon - Logoffl"
  86.    call close(file)
  87. end
  88.  
  89. calls=left(calls, 5, '')
  90. time=left(time(), 5, 3)
  91. city=left(compress(CITY'', '0123456789 '), 14, ' ')
  92. city=translate(city, '}{|][\\\{', 'åäöÅÄ֙”„', ' ')
  93. username=translate(username, '}{|][\\\{', 'åäöÅÄ֙”„', ' ')
  94. username=left(username, 20, ' ')
  95. access=left(access, 3, '')
  96. bps=left(bps, 4, '')
  97.  
  98. LastUser=vit" "username""cyan"l "access""cyan"l "vit""city""cyan"l "vit""Bps ""cyan"l "vit""calls""cyan"l "vit""TIME""cyan" - "vit"??:??"cyan" l"
  99.  
  100. call open(logon,PATH'Lastuser/Lastuser.txt','R')
  101.      do until a=9
  102.         a=a+1
  103.         rad.a = readln(logon)
  104.         if length(rad.a)<67 then rad.a=rad.a'Hang! l'
  105.      end
  106.      call close(logon)
  107.  
  108. lng=length(total_calls)
  109.  
  110. if access="0" then call WRITE
  111.  
  112. START:
  113. string=CLS
  114. call output ; string=""
  115. call output ; string="                        LastUser v4.21 for MebbsNet BBS"
  116. call output ; string="    Copyright (c) 1994 Active! Mikael Johansson M6005, All Rights Reserved. "
  117. call output ; string=""
  118. call output ; string=vit" +"cyan"--"vit"+"cyan"---------------------"vit"+"cyan"----"vit"+"cyan"---------------"vit"+"cyan"------"vit"+"cyan"------"vit"+"cyan"-------"vit"+"cyan"-------"vit"+"
  119. call output ; string=vit" l"bla2""vit"##"svart2""vit"l"bla2""vit" Name                "vit"l"bla2""vit" Axx"svart2""vit"l"bla2""vit" City          "svart2""vit"l"bla2""vit" Baud "svart2""vit"l"bla2""vit" Calls"svart2""vit"l"bla2""vit" Logon "svart2""vit"l"bla2""vit" Logoff"svart2""vit"l"
  120. call output ; string=vit" +"cyan"--"vit"+"cyan"---------------------"vit"+"cyan"----"vit"+"cyan"---------------"vit"+"cyan"------"vit"+"cyan"------"vit"+"cyan"---------------"vit"+"
  121. call output ; string=cyan" l"bla2""vit" 1"svart2""cyan"l"LastUser
  122. call output ; string=cyan" l"bla2""vit" 2"svart2""cyan"l"cyan""rad.1
  123. call output ; string=cyan" l"bla2""vit" 3"svart2""cyan"l"CYAN""rad.2
  124. call output ; string=cyan" l"bla2""vit" 4"svart2""cyan"l"CYAN""rad.3
  125. call output ; string=cyan" l"bla2""vit" 5"svart2""cyan"l"CYAN""rad.4
  126. call output ; string=cyan" l"bla2""vit" 6"svart2""cyan"l"CYAN""rad.5
  127. call output ; string=cyan" l"bla2""vit" 7"svart2""cyan"l"CYAN""rad.6
  128. call output ; string=cyan" l"bla2""vit" 8"svart2""cyan"l"CYAN""rad.7
  129. call output ; string=cyan" l"bla2""vit" 9"svart2""cyan"l"CYAN""rad.8
  130. call output ; string=cyan" l"bla2""vit"10"svart2""cyan"l"CYAN""rad.9
  131. call output ; string=vit" +"cyan"--"vit"+"cyan"---------------------"vit"+"cyan"----"vit"+"cyan"---------------"vit"+"cyan"------"vit"+"cyan"------"vit"+"cyan"---------------"vit"+"
  132.  
  133. if lng=1 then do
  134.     call output
  135.     string=vit" l"bla2"                           Total calls today: "total_calls"                            "svart2"l"
  136.     end
  137.  
  138. if lng=2 then do
  139.     call output
  140.     string=vit" l"bla2"                           Total calls today: "total_calls"                           "svart2"l"
  141.     end
  142.  
  143. call output ; string=vit" +"cyan"---------------------------------------------------------------------------"vit"+"
  144. call output ; string="                                                                           "
  145. call output
  146. call HotKey DoorName,LineNumber,"Press any key "
  147.  
  148. WRITE:
  149. if LineNumber ~= "0" then do
  150.    LastUser=" "username"l "access"l "city"l "bps" l "calls"l "TIME" - "
  151.    call open file, (PATH'Lastuser/Lastuser.txt'), 'W'
  152.    call writeln file, LastUser
  153.    call writeln file, rad.1
  154.    call writeln file, rad.2
  155.    call writeln file, rad.3
  156.    call writeln file, rad.4
  157.    call writeln file, rad.5
  158.    call writeln file, rad.6
  159.    call writeln file, rad.7
  160.    call writeln file, rad.8
  161.    call writeln file, rad.9
  162.    call close file
  163. end
  164.  
  165. call end_it
  166.  
  167. output:
  168. call message DoorName,LineNumber,string,1
  169. return 
  170.  
  171. ERROR:
  172.     string=''                                                      
  173.     call output ; string='*BOOM*  Got an error.  PLEASE notify the sysop.'       
  174.     call output ; string='Line:' SIGL '   Severity:' RC                          
  175.     call output ; string=''                                                      
  176.     call output ; string='PLEASE write down the TYPE of ERROR and the LINE # and'
  177.     call output ; string='leave the SYSOP a message so he may get it corrected.' 
  178.     call output
  179.     call HotKey DoorName,LineNumber,"Press any key "
  180.     call Exit_Door DoorName,LineNumber
  181.     exit 10
  182.  
  183. end_it:
  184. call DELETE("mebbsnet:call.log")
  185. call OPEN file, ('mebbsnet:call.log'), 'W'
  186. call WRITECH(file,'')
  187. call CLOSE file
  188.  
  189. call Exit_Door DoorName,LineNumber
  190. exit 0
  191.